/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 进度条 */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 4px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.progress-text {
    text-align: center;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    position: relative;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    width: 100%;
    top: 0;
    pointer-events: none; /* 关键修复：不活跃的卡片不接收点击事件 */
    visibility: hidden; /* 关键修复：不活跃的卡片完全隐藏 */
}

.card.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
    pointer-events: auto; /* 活跃的卡片恢复点击事件 */
    visibility: visible; /* 活跃的卡片可见 */
}

.card.slide-out {
    opacity: 0;
    transform: translateX(-100%);
}

.card-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h2 {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-header p {
    color: #718096;
    font-size: 1rem;
}

.card-body {
    padding: 30px;
}

/* 欢迎页面 */
.welcome-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 20px;
}

.welcome-text {
    text-align: center;
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 25px;
}

/* 股票输入框样式 */
.stock-input-container {
    margin-bottom: 25px;
}

.stock-input-label {
    display: block;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.stock-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #f7fafc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stock-input:focus {
    outline: none;
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.stock-input::placeholder {
    color: #a0aec0;
    font-size: 0.95rem;
}

/* 交易备注输入框样式 */
.notes-input-container {
    margin-bottom: 25px;
}

.notes-input-label {
    display: block;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 10px;
}

.notes-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: #f7fafc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    resize: vertical;
    min-height: 100px;
}

.notes-input:focus {
    outline: none;
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.notes-input::placeholder {
    color: #a0aec0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notes-char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #718096;
    margin-top: 5px;
}

/* 历史记录按钮区域 */
.history-actions {
    text-align: center;
    margin-bottom: 25px;
}

/* 问题选项 */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1.2rem;  /* 增大字体大小 */
    font-weight: 500;
    position: relative;
    overflow: hidden;
    line-height: 1.5;   /* 增加行高提高可读性 */
}

.option-btn:hover {
    border-color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.2);
}

.option-btn.buy {
    border-color: #f56565;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

.option-btn.buy:hover {
    border-color: #e53e3e;
    box-shadow: 0 5px 15px rgba(245, 101, 101, 0.3);
}

.option-btn.sell {
    border-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
}

.option-btn.sell:hover {
    border-color: #38a169;
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.option-btn.selected {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-color: #4facfe;
}

/* 按钮样式 */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    pointer-events: auto;
    z-index: 100;
    position: relative;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* 结果页面 */
.result-icon {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 20px;
}

.result-message {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 10px;
}

.result-message.success {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    color: #22543d;
    border: 2px solid #68d391;
}

.result-message.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef5e7 100%);
    color: #744210;
    border: 2px solid #f6ad55;
}

.result-message.danger {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    color: #742a2a;
    border: 2px solid #fc8181;
}

.decision-summary {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.decision-summary h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #4a5568;
    font-weight: 500;
}

.summary-value {
    color: #2d3748;
    font-weight: 600;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 历史记录样式 */
.history-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 30px;
}

.history-item {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.btn-export {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-export:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-export:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-stock {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.history-date {
    font-size: 0.9rem;
    color: #718096;
}

.history-operation {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.history-operation.buy {
    background: #fed7d7;
    color: #742a2a;
}

.history-operation.sell {
    background: #c6f6d5;
    color: #22543d;
}

.history-result {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.history-result.success {
    color: #38a169;
}

.history-result.warning {
    color: #d69e2e;
}

.history-result.danger {
    color: #e53e3e;
}

.history-details {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.4;
}

.history-details strong {
    color: #2d3748;
    font-weight: 600;
}

.history-empty {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 40px 20px;
}

.history-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 底部 */
.footer {
    margin-top: 30px;
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .card-header, .card-body {
        padding: 20px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .option-btn {
        padding: 15px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.card.entering {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    animation: pulse 0.3s ease;
}
